package com.zmt.mrms.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.zmt.mrms.interceptor.AdminInterceptor;

@Configuration
public class AdminConfig implements WebMvcConfigurer {

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		// 注册TestInterceptor拦截器
		InterceptorRegistration registration = registry.addInterceptor(new AdminInterceptor());
		// 被拦截的路径
		registration.addPathPatterns("/admin", "/admin/**");
		// 白名单，不拦截路径
		registration.excludePathPatterns("/admin/login");
	}
}
